package com.song.cmsservice.client;

import com.song.cmsservice.entity.frontvo.CourseFrontVo;
import com.song.commonutils.ResultObj;
import com.song.commonutils.ordervo.CourseWebVoOrder;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @author song
 * @data 2020/4/3
 */
@FeignClient(name = "service-edu")
@Component
public interface IndexFeign {

    /**
     * 查询前8热门课程
     * @return
     */
    @GetMapping("/eduservice/indexfront/index")
    Object index();

    /**
     * 查询前4名师
     * @return
     */
    @GetMapping("/eduservice/indexfront/indexTeacher")
    Object indexTeacher();

    /**
     * 分页查询前台讲师
     * @param current
     * @param limit
     * @return
     */
    @GetMapping("/eduservice/teacherFront/getTeacherFront/{current}/{limit}")
    ResultObj list(@RequestParam("current") long current, @RequestParam("limit") long limit);

    /**
     * 讲师详情
     * @param teacherId
     * @return
     */
    @GetMapping("/eduservice/teacherFront/getTeacherInfo/{teacherId}")
    ResultObj getTeacherInfo(@PathVariable("teacherId") String teacherId);

    /**
     * 条件查询带分页查询课程
     * @param page
     * @param limit
     * @param courseFrontVo
     * @return
     */
    @PostMapping("/eduservice/courseFront/getFrontCourseList/{page}/{limit}")
    ResultObj getFrontCourseList(@PathVariable("page") long page, @PathVariable("limit") long limit,
                                        @RequestBody(required = false) CourseFrontVo courseFrontVo);

    /**
     * 课程详情的方法
     * @param courseId
     * @return
     */
    @GetMapping("/eduservice/courseFront/getFrontCourseInfo/{courseId}")
    ResultObj getFrontCourseInfo(@PathVariable("courseId") String courseId);


    /**
     * 查询所有课程
     * @return
     */
    @GetMapping("/eduservice/subject/")
    ResultObj findAllSubject();


    /**
     * 根据课程id查询课程信息
     * @param id
     * @return
     */
    @PostMapping("/eduservice/courseFront/getCourseInfoOrder/{id}")
    CourseWebVoOrder getCourseInfoOrder(@PathVariable("id") String id);
}
